<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of TestAction
 *
 * @author wuxiaofeng
 */
class TestAction extends MenuAction{
    //put your code here
    function index(){
        $Content = M('Content');
        $Category=M('Category');

        $mainnavi1 = $Category->where('category_state=1')->order('category_sort ASC')->select();
        $infosa1=array();
        foreach($mainnavi1 as $key => $acategory){
            $infoa1=$Content->where('category_id='.$acategory['category_id'].' AND content_state=1')->order('content_time desc')
                    ->limit(6)->select();
            $infosa1[]=$infoa1;
        }
        
        //var_dump($infosa1);
        //exit;
        /*$somechannel = $Channel->where('channel_index=1 AND channel_state=1')
		->order('channel_sort ASC')->select();
		$infos = array();
		foreach ($somechannel as $key => $achannel) {
			$info = $Content->where('channel_id='.$achannel['channel_id'] .' AND content_state=1')->order('content_time desc')
			->limit($achannel['channel_index_count'])->select();
			$athumb = $ContentThumb->where('thumb_channelid='.$achannel['channel_id'])->order('thumb_id desc')->find();
			$smallimages[] = $athumb;
			$infos[] = $info;
		}*/
        
        $this->assign('infosa1',$infosa1);
        $this->display();
    }
}

?>
